#ifndef __MENU_CONFIG_H_
#define __MENU_CONFIG_H_
#include "main.h" 

struct config_uart
{
    uint32_t baudrate;
	uint16_t databits;
    uint16_t parity;
    uint16_t stopbits;
};

struct config_protocol
{
    uint16_t type;
    char  pre_command[64];
    uint16_t pre_timout;
    char command[64];
    uint16_t timeout;
    uint16_t parser;
	uint16_t endian;
};

struct config_output
{
    uint16_t begin_byte;
    uint16_t length;
    uint16_t end_byte;
	uint16_t place;
	uint16_t number; 
};

struct config
{

    uint16_t device_id;
    uint16_t version_max ;
    uint16_t version_min ;
    uint16_t samp_interval_s;

    struct config_uart uart;
    struct config_protocol protocol;
    struct config_output output;

};
extern struct config config;
int config_reset(void);
int config_check(void);
int config_get_cfg(void);

#endif